home *** CD-ROM | disk | FTP | other *** search
- // Let's make some constant names
- #declare CS_Easy = 1
- #declare CS_Medium = 3
- #declare CS_Hard = 5
-
- // Let the user choose the method to use
- #declare Complexity_Switch = CS_Medium // or CS_Easy or CS_Hard
-
- // Do something dependent on the user's choice
- #switch (Complexity_Switch)
- #case (CS_Easy)
- // This statement is done if (Complexity_Switch = CS_Easy)
- #declare MyShape = box{-1,+1}
- #break // end of CS_Easy
- #case (CS_Medium, CS_Hard)
- // This statement is done if Complexity_Switch is CS_Medium
- // or CS_Hard or anything in between
- #declare MyShape = torus{1, 0.5}
- #break // end of CS_Hard
- #else
- // This statement is done if none of the above match
- #declare MyShape = sphere{0,1}
- #end
-